package com.tvunetworks.center.device.model.vo;

import com.tvunetworks.center.common.model.dto.instance.ApiParam;
import com.tvunetworks.center.device.model.GridMetadata;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;

/**
 * @program: tvucc-aggregator
 * @description: Device api param
 * @author Kevin_Li
 * @create: 2019-10-10 12:51
 **/

@Slf4j
@Data
public class DeviceApiParam  extends ApiParam {


    private String session;
    private String type;
    private boolean pack;
    private boolean anyWhere;
    private boolean gridPack;
    private boolean gridSdi;
    private boolean ext;
    private boolean receiver;
    private int currentPageNum;
    private int everyPageNum = 10;
    private String peerId;
    private String peerIds;
    private GridMetadata gridMetadata;
    private String condition;
    private String name;


    @Override
    public boolean paramError() {
        if (StringUtils.isBlank(requestId) || StringUtils.isBlank(appkey) || StringUtils.isBlank(timestamp) || StringUtils.isBlank(signature)) {
            log.error("ApiListGroupParam paramError requestId:[{}] appkey:[{}] timestamp:[{}] signature:[{}]", requestId, appkey, timestamp, signature);
            return true;
        }
        return false;
    }
}
